package com.decorate.demo05;

/**
 * 5.具体装饰角色，FooterDecorator 装饰发票尾
 */
public class FooterDecorator extends OrderDecorator{

    public FooterDecorator(Order order) {
        super(order);
    }

    public void print(){
//        super.print();
        super.order.print();
        // 装饰发票主体，增加发票尾部
        printFooter();
    }

    private void printFooter(){
        System.out.println("==================================================");
        System.out.println("                                    总金额：" + formatCurrency(order.getTotal()));
    }
}
